package com.xujl.mvcbind.bean;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

import java.io.Serializable;

@Entity(nameInDb = "work")
public class OverTimeEntity implements Serializable {
    public static final int TYPE_OVERTIME = 0;
    public static final int TYPE_LEAVE = 1;
    public static final long serialVersionUID = 1L;
    @Id(autoincrement = true)
    private Long id;
    private Long date;
    private Integer type;
    private String duration;
    private String remark;

    @Generated(hash = 399320738)
    public OverTimeEntity (Long id, Long date, Integer type, String duration,
                           String remark) {
        this.id = id;
        this.date = date;
        this.type = type;
        this.duration = duration;
        this.remark = remark;
    }

    @Generated(hash = 401820282)
    public OverTimeEntity () {
    }

    public Long getId () {
        return this.id;
    }

    public void setId (Long id) {
        this.id = id;
    }

    public Long getDate () {
        return this.date;
    }

    public void setDate (Long date) {
        this.date = date;
    }

    public Integer getType () {
        return this.type;
    }

    public void setType (Integer type) {
        this.type = type;
    }

    public String getDuration () {
        return this.duration;
    }

    public void setDuration (String duration) {
        this.duration = duration;
    }

    public String getRemark () {
        return this.remark;
    }

    public void setRemark (String remark) {
        this.remark = remark;
    }

    public static boolean isOverTime (Integer type) {
        return type != null && type == TYPE_OVERTIME;
    }

}
